#if 0
#include <d3dx9.h>

#pragma comment( lib, "D3D9.lib" )
#pragma comment( lib, "D3DX9.lib" )

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

#include <stdio.h>

const char* ToString(D3DXPARAMETER_TYPE type)
{
	switch (type)
	{
	case D3DXPT_VOID:			return "VOID";
	case D3DXPT_BOOL:			return "BOOL";
	case D3DXPT_INT:			return "INT";
	case D3DXPT_FLOAT:			return "FLOAT";
	case D3DXPT_STRING:			return "STRING";
	case D3DXPT_TEXTURE:		return "TEXTURE";
	case D3DXPT_TEXTURE1D:		return "TEXTURE1D";
	case D3DXPT_TEXTURE2D:		return "TEXTURE2D";
	case D3DXPT_TEXTURE3D:		return "TEXTURE3D";
	case D3DXPT_TEXTURECUBE:	return "TEXTURECUBE";
	case D3DXPT_SAMPLER:		return "SAMPLER";
	case D3DXPT_SAMPLER1D:		return "SAMPLER1D";
	case D3DXPT_SAMPLER2D:		return "SAMPLER2D";
	case D3DXPT_SAMPLER3D:		return "SAMPLER3D";
	case D3DXPT_SAMPLERCUBE:	return "SAMPLERCUBE";
	case D3DXPT_PIXELSHADER:	return "PIXELSHADER";
	case D3DXPT_VERTEXSHADER:	return "VERTEXSHADER";
	case D3DXPT_PIXELFRAGMENT:	return "PIXELFRAGMENT";
	case D3DXPT_VERTEXFRAGMENT:	return "VERTEXFRAGMENT";
	case D3DXPT_UNSUPPORTED:	return "UNSUPPORTED";
	default:					return "ERROR";
	}
}

const char* ToString(D3DXREGISTER_SET v)
{
	switch (v)
	{
	case D3DXRS_BOOL:		return "BOOL";
	case D3DXRS_INT4:		return "INT4";
	case D3DXRS_FLOAT4:		return "FLOAT4";
	case D3DXRS_SAMPLER:	return "SAMPLER";
	default:				return "ERROR";
	}
}

const char* ToString(D3DXPARAMETER_CLASS v)
{
	switch (v)
	{
	case D3DXPC_SCALAR:			return "SCALAR";
	case D3DXPC_VECTOR:			return "VECTOR";
	case D3DXPC_MATRIX_ROWS:	return "MATRIX_ROWS";
	case D3DXPC_MATRIX_COLUMNS:	return "MATRIX_COLUMNS";
	case D3DXPC_OBJECT:			return "OBJECT";
	case D3DXPC_STRUCT:			return "STRUCT";
	default:					return "ERROR";
	}
}

int main(int argc, char** argv)
{
	// Initialise
	LPDIRECT3D9 pD3D = Direct3DCreate9( D3D_SDK_VERSION );

	D3DPRESENT_PARAMETERS pp;
	ZeroMemory(&pp, sizeof(pp));

	LPDIRECT3DDEVICE9 pD3DDevice = NULL;
	pD3D->CreateDevice( 
		D3DADAPTER_DEFAULT, 
		D3DDEVTYPE_NULLREF, 
		NULL,
		D3DCREATE_SOFTWARE_VERTEXPROCESSING,
		&pp, 
		&pD3DDevice );

	// Load shader
	LPCSTR szShaderInputFilename = argv[1];
	LPCSTR szShaderEntryPoint = argv[2];
	LPCSTR szShaderProfile = argv[3];

	LPD3DXBUFFER compiledShader = 0;
	LPD3DXCONSTANTTABLE constantTable = 0;
	LPD3DXBUFFER errorMessages = 0;
	if (S_OK == D3DXCompileShaderFromFile(szShaderInputFilename, NULL, NULL, szShaderEntryPoint, szShaderProfile, 0, &compiledShader, &errorMessages, &constantTable))
	{
		D3DXCONSTANTTABLE_DESC desc;
		constantTable->GetDesc(&desc);

		for (UINT idxConstant = 0; idxConstant < desc.Constants; ++idxConstant)
		{
			D3DXHANDLE hConstant = constantTable->GetConstant(NULL, idxConstant);
			UINT count = 0;
			D3DXCONSTANT_DESC constantDesc;
			constantTable->GetConstantDesc(hConstant, &constantDesc, &count);
			fprintf(stdout, "%s*%s*%d*%d*%s*%s*%d*%d*%d*%d*%d\n", 
				constantDesc.Name, 
				ToString(constantDesc.RegisterSet),
				constantDesc.RegisterIndex,
				constantDesc.RegisterCount,
				ToString(constantDesc.Class),
				ToString(constantDesc.Type),
				constantDesc.Rows,
				constantDesc.Columns,
				constantDesc.Elements,
				constantDesc.StructMembers,
				constantDesc.Bytes
				);
		}
  
		constantTable->Release();
		if (errorMessages) errorMessages->Release();
		compiledShader->Release();
	}
	else
	{
		if (errorMessages)
			fprintf(stderr, "%s", errorMessages->GetBufferPointer());
	}

	// Shutdown
	pD3DDevice->Release();
	pD3D->Release();
	return 0;
}
#endif